{template header}

<script type="text/javascript" src="{WEBURLPATH}/javascript/yetii.js"></script>

<!--{if $webglobal[mode]=='categoryadd'}-->
	<table class="menutable" cellspacing="1">
		<thead>
			<tr><td>{$webglobal[file_category][title]}分类管理</td></tr>
		</thead>
		<tbody>
			<tr><td>
				<a href="{ADMIN_WEBURLPATH}/index.php?mode=category&type={$webglobal[file_category][type]}">[分类列表]</a>
			</td></tr>
		</tbody>
	</table>

	<form name="addform" method="post" action="{ADMIN_WEBURLPATH}/index.php?mode=categoryadd&check">
	<input type="hidden" name="type" value="{$webglobal[file_category][type]}" />
	<table class="datatable" cellspacing="1">
		<thead>
			<tr><td colspan="2">添加{$webglobal[file_category][title]}分类</td></tr>
		</thead>
		<tbody>
			<tr>
				<th>上级分类</th>
				<td>
					<select name="upid">
					<option value="0">选择上级..</option>
					<!--{loop $webglobal[file_category][categoryoption] $categoryID $option}-->
					<option value="{$categoryID}">{$option[showName]}</option>
					<!--{/loop}-->
					</select>
				</td>
			</tr>
			<tr>
				<th>分类名称<span class="need"> *</span></th>
				<td><input type="text" name="categoryname" size="40" value="" /></td>
			</tr>
			<!--{if $webglobal[file_category][type] == 'area'}-->
			<tr>
				<th>字母缩写<span class="need"> *</span><div>由字母或数字组成</div></th>
				<td><input type="text" name="categoryshort" size="40" value="" /></td>
			</tr>
			<tr>
				<th>类型</th>
				<td>
					<select name="categorylevel">
					<!--{loop $webglobal[file_category][leveloption] $levelkey $levelvalue}-->
					<option value="{$levelkey}">{$levelvalue}</option>
					<!--{/loop}-->
					</select>
				</td>
			</tr>
			<!--{/if}-->
			<tr>
				<th>排序</th>
				<td><input type="text" name="categorysort" size="10" value="0" /></td>
			</tr>
		</tbody>
		<tfoot>
			<tr><td colspan="2">
				<input type="submit" name="adminsubmit" class="submitok" value=" 确  认 " />&nbsp;&nbsp;
				<input type="reset" name="adminreset" value=" 取  消 " />
			</td></tr>
		</tfoot>
	</table>
	</form>

<!--{elseif $webglobal[mode]=='categoryedit'}-->
	<table class="menutable" cellspacing="1">
		<thead>
			<tr><td>{$webglobal[file_category][title]}分类管理</td></tr>
		</thead>
		<tbody>
			<tr><td>
				<a href="{ADMIN_WEBURLPATH}/index.php?mode=category&type={$webglobal[file_category][type]}">[分类列表]</a>
			</td></tr>
		</tbody>
	</table>

	<form name="addform" method="post" action="{ADMIN_WEBURLPATH}/index.php?mode=categoryedit&check">
	<input type="hidden" name="type" value="{$webglobal[file_category][type]}" />
	<input type="hidden" name="editid" value="{$webrequest[editid]}" />
	<table class="datatable" cellspacing="1">
		<thead>
			<tr><td colspan="2">修改{$webglobal[file_category][title]}分类</td></tr>
		</thead>
		<tbody>
			<tr>
				<th>上级分类</th>
				<td>
					<select name="upid">
					<option value="0">选择上级..</option>
					<!--{loop $webglobal[file_category][categoryoption] $categoryID $option}-->
					<option value="{$categoryID}"{if $categoryID==$webglobal[file_category][editinfo][upid]} selected{/if}>{$option[showName]}</option>
					<!--{/loop}-->
					</select>
				</td>
			</tr>
			<tr>
				<th>分类名称<span class="need"> *</span></th>
				<td><input type="text" name="categoryname" size="40" value="{$webglobal[file_category][editinfo][name]}" /></td>
			</tr>
			<!--{if $webglobal[file_category][type] == 'area'}-->
			<tr>
				<th>字母缩写<span class="need"> *</span><div>由字母或数字组成</div></th>
				<td><input type="text" name="categoryshort" size="40" value="{$webglobal[file_category][editinfo][short_english]}" /></td>
			</tr>
			<tr>
				<th>类型</th>
				<td>
					<select name="categorylevel">
					<!--{loop $webglobal[file_category][leveloption] $levelkey $levelvalue}-->
					<option value="{$levelkey}"{if $levelkey == $webglobal[file_category][editinfo][level]} selected{/if}>{$levelvalue}</option>
					<!--{/loop}-->
					</select>
				</td>
			</tr>
			<!--{/if}-->
			<tr>
				<th>排序</th>
				<td><input type="text" name="categorysort" size="10" value="{$webglobal[file_category][editinfo][sort]}" /></td>
			</tr>
		</tbody>
		<tfoot>
			<tr><td colspan="2">
				<input type="submit" name="adminsubmit" class="submitok" value=" 确  认 " />&nbsp;&nbsp;
				<input type="reset" name="adminreset" value=" 取  消 " />
			</td></tr>
		</tfoot>
	</table>
	</form>
<!--{elseif $webglobal[mode]=='category'}-->
	<table class="menutable" cellspacing="1">
		<thead>
			<tr><td>{$webglobal[file_category][title]}分类管理</td></tr>
		</thead>
		<tbody>
			<tr><td>
				<a href="{ADMIN_WEBURLPATH}/index.php?mode=categoryadd&type={$webglobal[file_category][type]}">[添加分类]</a>
			</td></tr>
		</tbody>
	</table>

	
	<table class="datatable" cellspacing="1">
		<thead> 
			<tr>
				<th width="5%">编号</th>
				<th>分类名称</th>
				<!--{if $webglobal[file_category][type] == 'area'}-->
				<th width="25%">分类标识</th>
				<th width="5%">类型</th>
				<!--{/if}-->
				<th width="10%">排序</th>
				<th width="10%">管理</th>
			</tr>
		</thead>
		<tbody>
		<!--{if $webglobal[file_category][dataarray]}-->
			<!--{loop $webglobal[file_category][dataarray] $categoryID $categoryValue}-->
			<tr>
				<td{$categoryValue[tdclass]}>{$categoryID}</td>
				<td{$categoryValue[tdclass]}>{$categoryValue[showName]}</td>
				<!--{if $webglobal[file_category][type] == 'area'}-->
				<td{$categoryValue[tdclass]}>{$categoryValue[short_english]}</td>
				<td{$categoryValue[tdclass]}>{$categoryValue[levelname]}</td>
				<!--{/if}-->
				<td{$categoryValue[tdclass]}>{$categoryValue[sort]}</td>
				<td{$categoryValue[tdclass]}>
				<a href="{ADMIN_WEBURLPATH}/index.php?mode=categoryedit&editid={$categoryID}&type={$webglobal[file_category][type]}" class="special">[编辑]</a>
				<a href="javascript:if(confirm('您确定要删除该分类吗？')){window.location.href='{ADMIN_WEBURLPATH}/index.php?mode=categorydel&delid={$categoryID}&type={$webglobal[file_category][type]}'}" class="special">[删除]</a>
				</td>
			</tr>
			<!--{/loop}-->
		<!--{else}-->
			<tr><td colspan="10" style="text-align: center">暂时还没有任何分类。</td></tr>
		<!--{/if}-->
		</tbody>
	</table>
<!--{/if}-->

{template footer}